﻿Public Class BEUsuario
  Private _strNome As String
  Private _strAvatar As String
  Private _strCpf As String
  Private _strUsuario As String
  Private _strSenha As String
  Private _strPais As String
  Private _strUf As String
  Private _strCidade As String
  Private _strCep As String
  Private _strLogradouro As String
  Private _strEmail As String

  Private _objGrupoAcesso As extranet.BE.BEGrupoAcesso
  Private _objFranquia As extranet.BE.BEFranquia

  Public Sub New()
    _strNome = ""
    _strAvatar = ""
    _strCpf = ""
    _strUsuario = ""
    _strSenha = ""
    _strPais = ""
    _strUf = ""
    _strCidade = ""
    _strCep = ""
    _strLogradouro = ""
    _strEmail = ""

    _objGrupoAcesso = New BEGrupoAcesso()
    _objFranquia = New BEFranquia()
  End Sub

  Public Sub New(ByVal strNome As String)
    Me.New()
    _strNome = strNome
  End Sub

  Public Sub New(ByVal strUsuario As String, ByVal strSenha As String)
    Me.New()
    _strUsuario = strUsuario
    _strSenha = strSenha
  End Sub

  Public Property Nome() As String
    Get
      Return _strNome
    End Get
    Set(ByVal value As String)
      _strNome = value
    End Set
  End Property

  Public Property Avatar() As String
    Get
      Return _strAvatar
    End Get
    Set(ByVal value As String)
      _strAvatar = value
    End Set
  End Property

  Public Property Cpf() As String
    Get
      Return _strCpf
    End Get
    Set(ByVal value As String)
      If Not value.Contains(".") And value <> "" Then
        Dim strCPFFormatado As String = ""
        strCPFFormatado &= value.Substring(0, 3)
        strCPFFormatado &= "."
        strCPFFormatado &= value.Substring(3, 3)
        strCPFFormatado &= "."
        strCPFFormatado &= value.Substring(6, 3)
        strCPFFormatado &= "-"
        strCPFFormatado &= value.Substring(9, 2)
        _strCpf = strCPFFormatado
      Else
        _strCpf = value
      End If
    End Set
  End Property

  Public Property Usuario() As String
    Get
      Return _strUsuario
    End Get
    Set(ByVal value As String)
      _strUsuario = value
    End Set
  End Property

  Public Property Senha() As String
    Get
      Return _strSenha
    End Get
    Set(ByVal value As String)
      _strSenha = value
    End Set
  End Property

  Public Property Pais() As String
    Get
      Return _strPais
    End Get
    Set(ByVal value As String)
      _strPais = value
    End Set
  End Property

  Public Property Uf() As String
    Get
      Return _strUf
    End Get
    Set(ByVal value As String)
      _strUf = value
    End Set
  End Property

  Public Property Cidade() As String
    Get
      Return _strCidade
    End Get
    Set(ByVal value As String)
      _strCidade = value
    End Set
  End Property

  Public Property Cep() As String
    Get
      Return _strCep
    End Get
    Set(ByVal value As String)
      _strCep = value
    End Set
  End Property

  Public Property Logradouro() As String
    Get
      Return _strLogradouro
    End Get
    Set(ByVal value As String)
      _strLogradouro = value
    End Set
  End Property

  Public Property Email() As String
    Get
      Return _strEmail
    End Get
    Set(ByVal value As String)
      _strEmail = value
    End Set
  End Property

  Public Property GrupoAcesso() As extranet.BE.BEGrupoAcesso
    Get
      Return _objGrupoAcesso
    End Get
    Set(ByVal value As extranet.BE.BEGrupoAcesso)
      _objGrupoAcesso = value
    End Set
  End Property

  Public Property Franquia() As extranet.BE.BEFranquia
    Get
      Return _objFranquia
    End Get
    Set(ByVal value As extranet.BE.BEFranquia)
      _objFranquia = value
    End Set
  End Property

End Class
